package tr.edu.yildiz.dap.appeditor.model;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.equinox.internal.app.AppPersistence;

public class AppComponent {

	String name;
	String id;
	String groupId;
	String version;
	String urlString;
	
	List<AppComponent> dependencyList;
	
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getGroupId() {
		return groupId;
	}
	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public String getUrlString() {
		return urlString;
	}
	public void setUrlString(String urlString) {
		this.urlString = urlString;
	}
	public List<AppComponent> getDependencyList() {
		if (dependencyList == null)
			dependencyList = new ArrayList<AppComponent>();
		return dependencyList;
	}
	
	@Override
	public String toString() {
		return groupId + ":" + id;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof AppComponent))
			return false;
		AppComponent app = (AppComponent) obj;	
		return (toString()+version).equals(app.toString() + version);
	}
	
	
	
}
